package com.anan;

/**
 * project_name: easyai-labelimg
 * Author: Anan
 * time: 2025/2/22 12:10
 */


class YoloAnnotation {
    String classId;
    int x, y, width, height;

    public YoloAnnotation(String classId, int x, int y, int w, int h) {
        this.classId = classId;
        this.x = x;
        this.y = y;
        this.width = w;
        this.height = h;
    }

//    public String toYoloString(int imgW, int imgH) {
//        double centerX = (x + width/2.0) / imgW;
//        double centerY = (y + height/2.0) / imgH;
//        double nWidth = (double)width / imgW;
//        double nHeight = (double)height / imgH;
//        return String.format("%s %.6f %.6f %.6f %.6f",classId, centerX, centerY, nWidth, nHeight);
//    }
}
